import BaseEntity from '@/framework/domain/BaseEntity'
import SpuStatusEnum from '@/feature/pdt/infra/constants/SpuStatusEnum'

export default class SpuEntity extends BaseEntity {
  constructor(prop) {
    super(prop)
    this.status = SpuStatusEnum.getById(this.status)
    // this.spuNo = ''
  }

  get isOnline() {
    return this.status === SpuStatusEnum.ON
  }

  get isOffline() {
    return this.status === SpuStatusEnum.OFF
  }

  offline() {
    this.status = SpuStatusEnum.OFF
  }

  online() {
    this.status = SpuStatusEnum.ON
  }
}
